import http from "@/utils/http/hub";

/**
 * 选择房间计算价格
 */
export const calculatePrice = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/calculatePrice`,
    params,
    config,
  });
};

/**
 * 获取确认订单信息
 */
export const getConfirmOrder = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/confirmOrder`,
    params,
    config,
  });
};

/**
 * 获取结算信息
 */
export const getSettlement = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/settlement`,
    params,
    config,
  });
};

/**
 * 获取酒店订单列表
 */
export const getHotelOrderList = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.get({
    url: `/orderHotel/getList`,
    params,
    config,
  });
};

/**
 * 获取酒店订单详情
 */
export const getOrderDetail = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.get({
    url: `/orderHotel/detail`,
    params,
    config,
  });
};

/**
 * 确认服务
 */
export const receiptOrder = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/receiptOrder`,
    params,
    config,
  });
};

/**
 * 取消服务
 */
export const cancelOrder = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/cancelOrder`,
    params,
    config,
  });
};

/**
 * 申请售后
 */
export const refundOrder = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/refundOrder`,
    params,
    config,
  });
};

/**
 * 申请售后详情
 */
export const refundOrderDetail = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/refundOrderDetail`,
    params,
    config,
  });
};

/**
 * 取消申请售后
 */
export const cancelRefundOrder = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/cancelRefundOrder`,
    params,
    config,
  });
};

/**
 * 订单明细
 */
export const confirmOrderDetail = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/confirmOrderDetail`,
    params,
    config,
  });
};

/**
 * 修改订单状态
 */
export const updateOrderStatus = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/updateOrderStatus`,
    params,
    config,
  });
};

/**
 * 获取待评价订单信息
 */
export const getEvalOrder = (
  params,
  config = {
    custom: {
      auth: true,
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/orderHotel/evalOrder`,
    params,
    config,
  });
};


